/*
 * @Descripttion: $0
 * @version: 
 * @Author: linPing
 * @Date: 2019-10-29 01:26:12
 * @LastEditTime: 2019-10-29 12:27:16
 */
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, { Fragment } from 'react';

import { observer, inject } from 'mobx-react';
import NavigationBar from '../common/NavigationBar';
import GlobalStyles from "../res/styles/GlobalStyles";
import ViewUtil from "../util/ViewUtil";
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  Button,
  View,
  Text,
  StatusBar,
} from 'react-native';

const LIST_GROUP = {
  inspectionRecord: 'inspectionRecord',
  rectificationRecord: 'rectificationRecord',
}

@inject('appStore')
@observer
export default class RecordPage extends React.Component {
  onClick(menu) {
    const params = this.props.appStore
    let RouteName
    switch (menu.text) {
      case LIST_GROUP.inspectionRecord:
        RouteName = "inspectionRecord";
        params.title = "检查记录"
        break;
      case LIST_GROUP.inspectionRecord:
        RouteName = "rectificationRecord";
        params.title = "整改记录"
        break;
      default:
        break;
    }
    if (RouteName) {
      NavigationUtil.goPage(params, RouteName);
    }
  }
  getCustomItem(option) {
    return ViewUtil.getCustomItem(() => this.onClick(option), option.text,option.Icons);
  }
  render() {
    const { navigation } = this.props
    let themeColor = this.props.appStore.theme
    let statusBar = {
      backgroundColor: themeColor,
      barStyle: 'light-content',
    };
    let navigationBar =
      <NavigationBar
        title={'记录'}
        statusBar={statusBar}
        style={{ backgroundColor: themeColor }}
      />;
    return (

      <View style={GlobalStyles.root_container}>
        {navigationBar}
        <View>
          {this.getCustomItem({text:"检查记录"})}
          {this.getCustomItem({text:"整改记录"})}
        </View>

      </View>
    )
  }

};

const styles = StyleSheet.create({

  container: {
    flex: 1
  },


});

